﻿using System;
using NGuestBook.IBLL;

namespace NGuestBook.Factory
{
    /**//// <summary>
    /// 业务逻辑层工厂，用于获取相应的业务逻辑层对象
    /// 使用Abstract Factory设计模式+Facace设计模式+反射机制+缓存机制设计
    /// </summary>
    public sealed class BLLFactory
    {
        /**//// <summary>
        /// 获取管理员业务逻辑层对象
        /// </summary>
        /// <returns>管理员业务逻辑层对象</returns>
        public static IAdminBLL CreateAdminBLL()
        {
            return (IAdminBLL)DependencyInjector.GetBLLObject("AdminBLL");
        }

        /**//// <summary>
        /// 获取留言业务逻辑层对象
        /// </summary>
        /// <returns>留言业务逻辑层对象</returns>
        public static IMessageBLL CreateMessageBLL()
        {
            return (IMessageBLL)DependencyInjector.GetBLLObject("MessageBLL");
        }

        /**//// <summary>
        /// 获取评论业务逻辑层对象
        /// </summary>
        /// <returns>评论业务逻辑层对象</returns>
        public static ICommentBLL CreateCommentBLL()
        {
            return (ICommentBLL)DependencyInjector.GetBLLObject("CommentBLL");
        }
    }
}